package ReflectDemo;

import java.lang.reflect.Field;

public class PropertyUtils {
	
	public static void setProperty(Object obj, String propertyName, Object value) throws Exception {
		
		Class<?> clazz = obj.getClass();
		Field field = clazz.getDeclaredField(propertyName);
		field.setAccessible(true);
		field.set(obj, value);
	}

}
